package com.huawei.app.demo.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;

/**
 * 监听Home按键
 *
 * @since 2021-01-07
 */
public class HomePressEventReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();
        if ("com.device.rc.action.PRESS_HOME_NOTIFY_THIRD_APP".equals(action)) {
            Toast.makeText(context, "按下Home键...", Toast.LENGTH_SHORT).show();
        }
    }
}
